|
Eclipse Platform Pre-release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.team.core.subscribers.BackgroundEventHandler
This class provides the infrastucture for processing/dispatching of events in the background. This is useful to allow blocking operations to be more responsive by delegating event processing and UI updating to background job.
This is also useful for scheduling changes that require a workspace lock but can't be performed in a change delta.
Nested Class Summary | |
static class |
BackgroundEventHandler.Event
Resource event class. |
Constructor Summary | |
protected |
BackgroundEventHandler()
|
Method Summary | |
protected void |
createEventHandlingJob()
Create the job used for processing the events in the queue. |
protected abstract void |
dispatchEvents()
Notify clients of processed events. |
protected abstract String |
getErrorsTitle()
Return the text to be displayed as the title for any errors that occur. |
Job |
getEventHandlerJob()
|
abstract String |
getName()
Return the name of the handler, which is used as the job name. |
protected void |
handleException(CoreException e)
Handle the exception by recording it in the errors list. |
protected boolean |
isQueueEmpty()
Return whether there are unprocessed events on the event queue. |
boolean |
isShutdown()
|
protected void |
jobDone(IJobChangeEvent event)
This method is invoked when the processing job completes. |
protected abstract void |
processEvent(BackgroundEventHandler.Event event,
IProgressMonitor monitor)
Process the event in the context of a running background job. |
protected IStatus |
processEvents(IProgressMonitor monitor)
Process events from the events queue and dispatch results. |
protected void |
queueEvent(BackgroundEventHandler.Event event)
Queue the event and start the job if it's not already doing work. |
protected void |
schedule()
Schedule the job to process the events now. |
void |
shutdown()
Shutdown the event handler. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected BackgroundEventHandler()
Method Detail |
protected void createEventHandlingJob()
protected void jobDone(IJobChangeEvent event)
protected void schedule()
public abstract String getName()
protected abstract String getErrorsTitle()
public void shutdown()
public boolean isShutdown()
protected void queueEvent(BackgroundEventHandler.Event event)
protected boolean isQueueEmpty()
protected IStatus processEvents(IProgressMonitor monitor)
processEvent(Event)
which may check for and handle
cancelation by shuting down the receiver.
protected abstract void dispatchEvents() throws TeamException
TeamException
protected void handleException(CoreException e)
e
- protected abstract void processEvent(BackgroundEventHandler.Event event, IProgressMonitor monitor) throws CoreException
shutdown()
method.
event
- monitor
-
CoreException
public Job getEventHandlerJob()
|
Eclipse Platform Pre-release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |